package leetcode.weekly.week302;

//Solution1Test
public class Solution1 {
	// Solution1Test
	public int[] numberOfPairs(int[] nums) {
		int ans = 0, len = nums.length;
		boolean[] hash = new boolean[101];
		for (int i = 0; i < len; i++) {
			int num = nums[i];
			if (hash[num]) {
				ans += 1;
				hash[num] = false;
			} else {
				hash[num] = true;
			}
		}
		return new int[] { ans, len - (ans << 1) };
	}

}
